﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using Sogeti.VSExtention;

namespace Mskold.IterationManager
{
    /// <summary>
    /// Interaction logic for ChangeIteration.xaml
    /// </summary>
    public partial class ChangeIteration : Window
    {
        private IterationManagerConfig config;
        private TeamExplorerIntergator teamExplorerIntegrator;

        public ChangeIteration()
        {
            InitializeComponent();
        }

        public ChangeIteration(IterationManagerConfig config, TeamExplorerIntergator teIntegrator)
        {
            InitializeComponent();

            teamExplorerIntegrator = teIntegrator;

            vm = new ChangeIterationViewModel();

            vm.Load(teamExplorerIntegrator);
            this.DataContext = vm;
            grdChangeIteration.Visibility = vm.Config.ConfigStore.ChangeCurrentIteratonFolder ? Visibility.Visible : Visibility.Hidden;
            grdNoCurrentIterationConfig.Visibility = vm.Config.ConfigStore.ChangeCurrentIteratonFolder ? Visibility.Hidden : Visibility.Visible;


        }

        private ChangeIterationViewModel vm;

        private void cmdCancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void cmdOk_Click(object sender, RoutedEventArgs e)
        {
            vm.cmdChangeIteration(this);
          
            Close();
        }

      
    }
}
